import request from '@/utils/request'

// 用户的订单
export function fetchOrder(data) {
  return request({
    url: '/order/manageList',
    method: 'get',
    params: data
  })
}
// 商家的订单
export function fetchMerchantOrder(data) {
  return request({
    url: '/order/merchantList',
    method: 'get',
    params: data
  })
}
// 管理员查看所有订单
export function fetchMangerOrder(data) {
  return request({
    url: '/order/manageList',
    method: 'get',
    params: data
  })
}
// 订单发货
export function shipOrder(data) {
  return request({
    url: '/order/ship',
    method: 'post',
    params: data
  })
}

export function updateOrder(data) {
  return request({
    url: '/order/edit',
    method: 'post',
    params: data
  })
}

export function deleteOrder(params) {
  return request({
    url: '/order/delete',
    method: 'post',
    params
  })
}

export function searchOrder(name) {
  return request({
    url: '/order/find',
    method: 'get',
    params: { name }
  })
}
